<?php

namespace App\Admin\Controllers\Equipment;

use Dcat\Admin\Controllers\AdminController;
use Dcat\Admin\IFrameGrid;
use Dcat\Admin\Layout\Content;

class CommonEquipmentController extends AdminController
{
    public function index(Content $content)
    {
        if (request(IFrameGrid::QUERY_NAME)) {
            return $content->perfectScrollbar()->body($this->iFrameGrid());
        }

        return $content
            ->title($this->title())
            ->description($this->description()['index'] ?? trans('admin.list'))
            ->body(view('admin.equipment.index'));
    }
}
